
import 'package:flutter/material.dart';

class MyInhertedWidget extends InheritedWidget{

  final int count;

  MyInhertedWidget({required this.count,required super.child});

  static MyInhertedWidget? of(BuildContext context){
      //沿着Element树找最近的MyInhertedWidget，从Element中取出widget对象
      return context.dependOnInheritedWidgetOfExactType();
  }

  @override
  bool updateShouldNotify(MyInhertedWidget oldWidget) {
   return true;
  }
  
}